﻿using System.Web.Mvc;

namespace Maxi.Areas.Sistema
{
    public class SistemaAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Sistema";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {

            string[] namespaces = new string[] { "Maxi.Areas.Sistema.Controllers" };

            #region aluno
            context.MapRoute(
                name: "sistema.aluno.salvar",
                url: "salvaraluno",
                defaults: new { controller = "Aluno", action = "salvar" },
                namespaces: namespaces
            );


            context.MapRoute(
                name: "sistema.aluno.excluir",
                url: "excluiraluno",
                defaults: new { controller = "Aluno", action = "excluir" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.aluno.novo",
                url: "novoaluno",
                defaults: new { controller = "Aluno", action = "novo" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.aluno.edit",
                url: "editaraluno",
                defaults: new { controller = "Aluno", action = "editar" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.aluno.list",
                url: "Alunos",
                defaults: new { controller = "Aluno", action = "Index" },
                namespaces: namespaces
            );
            #endregion

            #region responsavel
            context.MapRoute(
               name: "sistema.responsavel.salvar",
               url: "salvarresponsavel",
               defaults: new { controller = "responsavel", action = "salvar" },
               namespaces: namespaces
           );


            context.MapRoute(
                name: "sistema.responsavel.excluir",
                url: "excluirresponsavel",
                defaults: new { controller = "responsavel", action = "excluir" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.responsavel.novo",
                url: "novoresponsavel",
                defaults: new { controller = "responsavel", action = "novo" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.responsavel.edit",
                url: "editarresponsavel",
                defaults: new { controller = "responsavel", action = "editar" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.responsavel.list",
                url: "responsaveis",
                defaults: new { controller = "responsavel", action = "Index" },
                namespaces: namespaces
            );
            #endregion

            #region professor
            context.MapRoute(
             name: "sistema.professor.salvar",
             url: "salvarprofessor",
             defaults: new { controller = "professor", action = "salvar" },
             namespaces: namespaces
         );


            context.MapRoute(
                name: "sistema.professor.excluir",
                url: "excluirprofessor",
                defaults: new { controller = "professor", action = "excluir" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.professor.novo",
                url: "novoprofessor",
                defaults: new { controller = "professor", action = "novo" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.professor.edit",
                url: "editarprofessor",
                defaults: new { controller = "professor", action = "editar" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.professor.list",
                url: "professores",
                defaults: new { controller = "professor", action = "Index" },
                namespaces: namespaces
            );
            #endregion

            #region turma
            context.MapRoute(
               name: "sistema.turma.salvar",
               url: "salvarturma",
               defaults: new { controller = "turma", action = "salvar" },
               namespaces: namespaces
           );


            context.MapRoute(
                name: "sistema.turma.excluir",
                url: "excluirturma",
                defaults: new { controller = "turma", action = "excluir" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.turma.novo",
                url: "novoturma",
                defaults: new { controller = "turma", action = "novo" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.turma.edit",
                url: "editarturma",
                defaults: new { controller = "turma", action = "editar" },
                namespaces: namespaces
            );

            context.MapRoute(
                name: "sistema.turma.list",
                url: "turmas",
                defaults: new { controller = "turma", action = "Index" },
                namespaces: namespaces
            );
            #endregion

            context.MapRoute(
                "sistema",
                "Sistema/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}